<template>
  <div class="header">
    <!-- 孙志豪 2102b 12 - 1 封装input框 -->
    <input
      :value="modelValue"
      placeholder="请搜索"
      @blur="blur"
      @input="changeValue"
      type="text"
    />
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  props: {
    modelValue: String,
  },
  setup(props, { emit }) {
    function changeValue(e) {
      emit("update:modelValue", e.target.value);
    }
    function blur() {
      emit("blur");
    }
    return { changeValue, blur };
  },
  components: {},
};
</script>

<style lang="scss" scoped>
.header {
  width: 100%;
  height: 40px;
  background-color: red;
  display: flex;
  align-items: center;
  justify-content: center;
  input {
    width: 70%;
    height: 80%;
    border-radius: 40px;
    padding-left: 20px;
  }
}
</style>
